<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.io.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.text.*"%>
<%@ page import="javax.sql.*"%>
<%@ page import="com.gzgi.framework.*"%>
<%@ page import="com.gzgi.framework.util.*"%>
<%@ page import="com.gzgi.framework.context.*"%>
<%@ page import="com.gzgi.framework.lob.*"%>
<%
		LobDataService lobDataService = (LobDataService) ContextFactory.getBean("lobDataService");
		 
	    SecurityContext securityContext = new SecurityContext();
        QueryContext queryContext = new QueryContext();

		String rowId = request.getParameter("rowId");
        if(rowId != null){
           BlobData blob = lobDataService.getBlobData(new Long(rowId));
           if(blob != null && blob.getData() != null){
			   out.println("data length:"+blob.getData().length);
			   out.println("<br>data "+new String(blob.getData()));
		   }
		}else{
			Page jpage = lobDataService.getPageLob(securityContext, queryContext);
			Iterator iter = jpage.getRows().iterator();
			while(iter.hasNext()){
				LobData data = (LobData)iter.next();
%>
                <br><a href="?rowId=<%=data.getId()%>"><%=data.getId()%></a>
<%
			}
		}
 %>